<?php
if (!Yii::app()->user->isGuest){
    Yii::app()->user->setReturnUrl('/index.php');
    Yii::app()->request->redirect(Yii::app()->user->returnUrl);
}
?>

<div class="login-form">
		<?php echo CHtml::beginForm(); ?>
            <table>
				<tr>
					<td>Логин</td>
					<td><?php echo CHtml::activeTextField($model,'username',array('style'=>'')) ?><br /></td>
				</tr>
				<tr>
					<td>Пароль</td>
					<td><?php echo CHtml::activePasswordField($model,'password',array('style'=>'')) ?></td>
				</tr>
			<table>
			<input type="image" value="Войти" src="../../images/login_but.png">
		<?php echo CHtml::endForm(); ?>
	</div>
